﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Grizzy_X
{
    public partial class StartForm : Form
    {
        public StartForm()
        {
            InitializeComponent();
            radioButton1.Checked = true;
            button1.Enabled = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //后期改为直接调用Persistence中的函数！！！！！！
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.ShowDialog();
        }

        private void OKbutton_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                Controller.StartOperation = "New";
                this.Close();
            }
            if (radioButton2.Checked == true)
            {
                Controller.StartOperation = "Open";
                this.Close();
            }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked == true)
            {
                button1.Enabled = true;
            }
            else
            {
                button1.Enabled = false;
            }
        }
    }
}
